<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>		
		<script type="text/javascript" src="http://localhost/wordpress/demo.com/js/jquery-latest.js"></script>
		<script type="text/javascript" src="http://localhost/wordpress/demo.com/js/jquery.validate.js"></script>
		<script type="text/javascript" src="http://localhost/wordpress/demo.com/js/prototype.js"></script>

	<body>
		<script type="text/javascript">
			function sendRequest() {
				new Ajax.Request("suscribir.php", 
					{ 
					method: 'post', 
					postBody: 'name='+ $F('user_name'),
					onComplete: showResponse 
					});
				}

			function showResponse(req){
				$('show').innerHTML= req.responseText;
			}
		</script>

		<script type="text/javascript">
			$(document).ready(function(){
		      $("#frmSuscripcion").validate({
		        rules:{
		          user_name: "required",
		          user_email:{required: true, email: true}
				}
		      });
		    });
		</script>

		<style>
		.csslabel
		{
			float:left;
			width:75px;
		}
		.cssinput
		{
			float:left;
			width:75px;
		}
		.csssubmit
		{
		}
		.cssfila
		{
			height:30px;
		}

		#msg_suscripcion
		{
			color:Red;
			font-weight:bold;
		}
		</style>

		<form name="frmSuscripcion" id="frmSuscripcion" onsubmit="return false;">
			<h2>Avisarme cuando ingresen nuevos Juegos</h2>
			<div class="cssfila">
			<div class="csslabel"><span class="xlabel">Nombre :</span></div>
			<div class="cssinput"><span class="xinput"><input id="user_name" name="user_name" type="text" size="20" /></span></div>
			</div>

			<div class="cssfila">
			<div class="csslabel"><span class="xlabel">Correo :</span></div>
			<div class="cssinput"><span class="xinput"><input id="user_email" name="user_email" type="text" size="20" /></span></div>
			</div>

			<input type="hidden" name="MM_idcampanna" value="2" />
			<input type="hidden" name="MM_insert_suscriptor" value="frmSuscripcion" />
			<input type="hidden" name="MM_url_redirect_suscripcion_bienvenida" value="" />
			<input type="hidden" name="MM_url_redirect_suscripcion_error" value="" />

			<input class="submit" type="submit" value="Enviar datos" onClick="sendRequest()" />
		</form>

		<div id="show"></div>
	</body>
</html>
